Syntax10.Scn.Fnt Syntax10i.Scn.Fnt Syntax14b.Scn.Fnt Syntax10b.Scn.Fnt MODULE AmigaConsole; (* updated OJ 30 Apr 96 *) (* Port and IOReq are not properly set, so don't send messages to this device! *) IMPORT SYSTEM, E := AmigaExec; consoleBase*: E.DevicePtr; iOStdReq: E.IOStdReq; termEntry : E.TermEntry; CONST consoleName * = "console.device"; (****** SGR parameters ******) primary * = 0; bold * = 1; italic * = 3; underscore * = 4; negative * = 7; normal * = 22; (* default foreground color, not bold *) notItalic * = 23; notUnderscore * = 24; positive * = 27; (* these names refer to the ANSI standard, not the implementation *) blank * = 30; red * = 31; green * = 32; yellow * = 33; blue * = 34; magenta * = 35; cyan * = 36; white * = 37; default * = 39; blackBg * = 40; redBg * = 41; greenBg * = 42; yellowBg * = 43; blueBg * = 44; magentaBg * = 45; cyanBg * = 46; whiteBg * = 47; defaultBg * = 49; (* these names refer to the implementation, they are the preferred *) (* names for use with the Amiga console device. *) clr0 * = 30; clr1 * = 31; clr2 * = 32; clr3 * = 33; clr4 * = 34; clr5 * = 35; clr6 * = 36; clr7 * = 37; clr0Bg * = 40; clr1Bg * = 41; clr2Bg * = 42; clr3Bg * = 43; clr4Bg * = 44; clr5Bg * = 45; clr6Bg * = 46; clr7Bg * = 47; (****** DSR parameters ******) dsrCpr * = 6; (****** CTC parameters ******) ctcHSetTab * = 0; ctcHClrTab * = 2; ctcHClrTabsAll * = 5; (****** TBC parameters ******) tbcHClrTab * = 0; tbcHClrTabsAll * = 3; (****** SM and RM parameters ******) mLNM * = 20; (* linefeed newline mode *) mASM * = ">1"; (* auto scroll mode *) mAWM * = "?7"; (* auto wrap mode *) PROCEDURE -ReturnD0 04EH,05EH, 04EH,075H; PROCEDURE RawKeyConvert*(events: LONGINT; VAR buffer: ARRAY OF SYSTEM.BYTE; length: LONGINT; keyMap: LONGINT) : LONGINT; BEGIN SYSTEM.PUTREG( 9, SYSTEM.ADR(buffer) ); SYSTEM.PUTREG( 8, events ); SYSTEM.PUTREG( 1, length ); SYSTEM.PUTREG( 10, keyMap ); SYSTEM.CALL( -48, consoleBase ); ReturnD0 END RawKeyConvert; PROCEDURE Init; BEGIN IF E.OpenDevice(consoleName, -1, SYSTEM.ADR(iOStdReq), {}) # 0 THEN HALT(99) END; consoleBase := iOStdReq.device END Init; PROCEDURE Term; BEGIN E.CloseDevice( SYSTEM.ADR(iOStdReq) ) END Term; BEGIN Init; E.Register(termEntry, Term); END AmigaConsole.